home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: How can I include IOSTREAM.H only once?
- Date: 3 Mar 1996 11:37:35 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4hc09v$136@news1.usa.pipeline.com>
- References: <4hbi55$899@sam.inforamp.net>
- NNTP-Posting-Host: pipe9.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 03, 1996 07:36:16 in article <Re: How can I include IOSTREAM.H only
- once?>, 'rmorin@inforamp.net (Randy Charles Morin)' wrote:
-
-
- >In article <4gre90$oei@service.polymtl.ca>,
- >bluefox@info.polymtl.ca (Michael Gaudette) wrote:
- >>I am presently engaged in what is usually called "the learning process",
-
- >>and I've been programming simple programs with classes. Because of this,
-
- >>I have had to #include <iostream.h> in most of my "class.cpp" files AND
- >>in my main program. This (added to conio.h and all the other standard
- >>libraries) usually result in a simple program being 20000 lines long.
- >>Is there any way (using Borland v4.5) to make the compiler only link
- >>those files ONCE?
- >
- >Tell the preprocessor to include the file only if it has not already been
-
- >included.
- >
- >#ifndef __IOSTREAM_H
- >#include <iostream.h>
- >#endif
- >
- >But, this can sometimes generate unexpected errors/warnings/bugs. So make
-
- >sure you know what you are doing when you use this technique.
- >
- I believe this answer is to a question other than the one asked.
- There's no way to accomplish what the original poster wants to do,
- although eader precompilation will ease the situation.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-